/*
 * @desc: TODO 定义请求的错误统一处理
 * @Author: zhangshaohui
 * @Date: 2021-07-27 11:06:32
 * @Last Modified by: zhangshaohui
 * @Last Modified time: 2021-07-27 11:12:24
 */
import { code } from './resCode';

const errorHandler = (error: { name?: string; statusCode?: number; response?: any }) => {
  const { response } = error;
    // TODO 接口错误
    if (error.name === 'InterfaceError') {}
    // TODO HTTP 错误
    if (error.name === 'HttpError') {}
  return response;
};
export default errorHandler;
